home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.util.ResourceUtil;
- import asp.wizard.util.UiUtil;
- import com.sun.java.swing.BorderFactory;
- import com.sun.java.swing.JButton;
- import com.sun.java.swing.JCheckBox;
- import com.sun.java.swing.JComboBox;
- import com.sun.java.swing.JLabel;
- import com.sun.java.swing.JPanel;
- import com.sun.java.swing.JScrollPane;
- import com.sun.java.swing.JTable;
- import com.sun.java.swing.JTextField;
- import com.sun.java.swing.border.Border;
- import com.sun.java.swing.table.DefaultTableModel;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Font;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.util.Vector;
-
- public class WVPanelDbListFormat extends WVPanelBase {
- private static final String ID_GRP_TABLEPROPERTIES = "group.tableproperties";
- private static final String ID_LBL_BORDERSIZE = "label.bordersize";
- private static final String ID_LBL_CELLPADDING = "label.cellpadding";
- private static final String ID_LBL_CELLSPACING = "label.cellspacing";
- private static final String ID_GRP_HEADERPROPERTIES = "group.headerproperties";
- private static final String ID_LBL_HEADERFACE = "label.headerface";
- private static final String ID_LBL_HEADERCOLOR = "label.headercolor";
- private static final String ID_LBL_HEADERSIZE = "label.headersize";
- private static final String ID_CKB_HEADERBOLD = "checkbox.headerbold";
- private static final String ID_CKB_HEADERITALIC = "checkbox.headeritalic";
- private static final String ID_CKB_HEADERUNDERLINE = "checkbox.headerunderline";
- private static final String ID_GRP_DATAPROPERTIES = "group.dataproperties";
- private static final String ID_LBL_DATAFACE = "label.dataface";
- private static final String ID_LBL_DATACOLOR = "label.datacolor";
- private static final String ID_LBL_DATASIZE = "label.datasize";
- private static final String ID_CKB_DATABOLD = "checkbox.databold";
- private static final String ID_CKB_DATAITALIC = "checkbox.dataitalic";
- private static final String ID_CKB_DATAUNDERLINE = "checkbox.dataunderline";
- private static final String ID_BTN_PREVIEW = "button.preview";
- private static final int INTAB_TOP_MARGIN = 3;
- private static final int INTAB_LEFT_MARGIN = 3;
- private static final int INTAB_BOTTOM_MARGIN = 3;
- private static final int INTAB_RIGHT_MARGIN = 3;
- JLabel _lblBorderSize;
- JTextField _txfBorderSize;
- JLabel _lblCellPadding;
- JTextField _txfCellPadding;
- JLabel _lblCellSpacing;
- JTextField _txfCellSpacing;
- JPanel _pnlTableProperties;
- JLabel _lblHeaderFace;
- JTextField _txfHeaderFace;
- JLabel _lblHeaderColor;
- JComboBox _cmbHeaderColor;
- JLabel _lblHeaderSize;
- JComboBox _cmbHeaderSize;
- JCheckBox _ckbHeaderBold;
- JCheckBox _ckbHeaderItalic;
- JCheckBox _ckbHeaderUnderline;
- JPanel _pnlHeaderProperties;
- JLabel _lblDataFace;
- JTextField _txfDataFace;
- JLabel _lblDataColor;
- JComboBox _cmbDataColor;
- JLabel _lblDataSize;
- JComboBox _cmbDataSize;
- JCheckBox _ckbDataBold;
- JCheckBox _ckbDataItalic;
- JCheckBox _ckbDataUnderline;
- JPanel _pnlDataProperties;
- JButton _btnPreview;
- ReadOnlyJTable _tblPreview;
- JScrollPane _scpPreview;
- DefaultTableModel _tbmPreview;
- // $FF: synthetic field
- static Class class$java$lang$String;
-
- private JCheckBox setupCheckBox(JCheckBox ckb) {
- if (ckb != null) {
- ((Component)ckb).setFont(new Font("Dialog", 0, 11));
- }
-
- return ckb;
- }
-
- protected void initModels() {
- super.initModels();
- ResourceUtil ru = ((WVPanelBase)this).getResourceUtil();
- Vector tableColumns = new Vector();
- this._tbmPreview = new DefaultTableModel();
- this._tbmPreview.setColumnIdentifiers(tableColumns);
- }
-
- protected void initComponents() {
- super.initComponents();
- this._tbmPreview = new DefaultTableModel();
- ResourceUtil ru = ((WVPanelBase)this).getResourceUtil();
- JPanel contentPanel = ((WVPanelBase)this).getContentPanel();
- Color bgcolor = ((Component)contentPanel).getBackground();
- Border etchedBorder = BorderFactory.createEtchedBorder();
- this._txfBorderSize = new JTextField();
- this._lblBorderSize = UiUtil.setupLabel(new JLabel(ru.getString("label.bordersize")), this._txfBorderSize);
- this._txfCellPadding = new JTextField();
- this._lblCellPadding = UiUtil.setupLabel(new JLabel(ru.getString("label.cellpadding")), this._txfCellPadding);
- this._txfCellSpacing = new JTextField();
- this._lblCellSpacing = UiUtil.setupLabel(new JLabel(ru.getString("label.cellspacing")), this._txfCellSpacing);
- this._pnlTableProperties = new JPanel();
- this._pnlTableProperties.setBorder(BorderFactory.createTitledBorder(etchedBorder, ru.getString("group.tableproperties"), 1, 2));
- this._txfHeaderFace = new JTextField();
- this._lblHeaderFace = UiUtil.setupLabel(new JLabel(ru.getString("label.headerface")), this._txfHeaderFace);
- this._cmbHeaderColor = new JComboBox();
- this._lblHeaderColor = UiUtil.setupLabel(new JLabel(ru.getString("label.headercolor")), this._cmbHeaderColor);
- this._cmbHeaderSize = new JComboBox();
- this._lblHeaderSize = UiUtil.setupLabel(new JLabel(ru.getString("label.headersize")), this._cmbHeaderSize);
- this._ckbHeaderBold = this.setupCheckBox(new JCheckBox(ru.getString("checkbox.headerbold")));
- this._ckbHeaderItalic = this.setupCheckBox(new JCheckBox(ru.getString("checkbox.headeritalic")));
- this._ckbHeaderUnderline = this.setupCheckBox(new JCheckBox(ru.getString("checkbox.headerunderline")));
- this._pnlHeaderProperties = new JPanel();
- this._pnlHeaderProperties.setBorder(BorderFactory.createTitledBorder(etchedBorder, ru.getString("group.headerproperties"), 1, 2));
- this._txfDataFace = new JTextField();
- this._lblDataFace = UiUtil.setupLabel(new JLabel(ru.getString("label.dataface")), this._txfDataFace);
- this._cmbDataColor = new JComboBox();
- this._lblDataColor = UiUtil.setupLabel(new JLabel(ru.getString("label.datacolor")), this._cmbDataColor);
- this._cmbDataSize = new JComboBox();
- this._lblDataSize = UiUtil.setupLabel(new JLabel(ru.getString("label.datasize")), this._cmbDataSize);
- this._ckbDataBold = this.setupCheckBox(new JCheckBox(ru.getString("checkbox.databold")));
- this._ckbDataItalic = this.setupCheckBox(new JCheckBox(ru.getString("checkbox.dataitalic")));
- this._ckbDataUnderline = this.setupCheckBox(new JCheckBox(ru.getString("checkbox.dataunderline")));
- this._pnlDataProperties = new JPanel();
- this._pnlDataProperties.setBorder(BorderFactory.createTitledBorder(etchedBorder, ru.getString("group.dataproperties"), 1, 2));
- this._btnPreview = new JButton(ru.getString("button.preview"));
- this._tblPreview = new FormattedPreviewTable();
- this._tblPreview.setAutoResizeMode(0);
- this._tblPreview.setModel(this._tbmPreview);
- this._scpPreview = JTable.createScrollPaneForTable(this._tblPreview);
- }
-
- protected void initLayout() {
- super.initLayout();
- JPanel contentPanel = ((WVPanelBase)this).getContentPanel();
- GridBagLayout gbl = new GridBagLayout();
- GridBagConstraints gbc = new GridBagConstraints();
- ((Container)contentPanel).setLayout(gbl);
- gbc.ipady = 5;
- UiUtil.addComponent(contentPanel, super._txpIntro, gbl, gbc, 0, 0, 2, 1, (double)1.0F, (double)0.0F, 18, 2, 0, 0, 0, 0);
- gbc.ipady = 0;
- GridBagLayout gblp = new GridBagLayout();
- this._pnlTableProperties.setLayout(gblp);
- UiUtil.addComponent(this._pnlTableProperties, this._lblBorderSize, gblp, gbc, 0, 0, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlTableProperties, this._txfBorderSize, gblp, gbc, 1, 0, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- UiUtil.addComponent(this._pnlTableProperties, this._lblCellPadding, gblp, gbc, 0, 1, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 2, 0, 0, 0);
- UiUtil.addComponent(this._pnlTableProperties, this._txfCellPadding, gblp, gbc, 1, 1, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 2, 5, 0, 0);
- UiUtil.addComponent(this._pnlTableProperties, this._lblCellSpacing, gblp, gbc, 0, 2, 1, 1, (double)0.0F, (double)1.0F, 18, 2, 2, 0, 0, 0);
- UiUtil.addComponent(this._pnlTableProperties, this._txfCellSpacing, gblp, gbc, 1, 2, 1, 1, (double)1.0F, (double)1.0F, 18, 2, 2, 5, 0, 0);
- UiUtil.addComponent(contentPanel, this._pnlTableProperties, gbl, gbc, 0, 1, 1, 1, (double)1.0F, (double)0.0F, 18, 1, 10, 0, 0, 0);
- gblp = new GridBagLayout();
- this._pnlHeaderProperties.setLayout(gblp);
- UiUtil.addComponent(this._pnlHeaderProperties, this._lblHeaderFace, gblp, gbc, 0, 0, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlHeaderProperties, this._txfHeaderFace, gblp, gbc, 1, 0, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = -1;
- UiUtil.addComponent(this._pnlHeaderProperties, this._ckbHeaderBold, gblp, gbc, 2, 0, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(this._pnlHeaderProperties, this._lblHeaderColor, gblp, gbc, 0, 1, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlHeaderProperties, this._cmbHeaderColor, gblp, gbc, 1, 1, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = -1;
- UiUtil.addComponent(this._pnlHeaderProperties, this._ckbHeaderItalic, gblp, gbc, 2, 1, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(this._pnlHeaderProperties, this._lblHeaderSize, gblp, gbc, 0, 2, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlHeaderProperties, this._cmbHeaderSize, gblp, gbc, 1, 2, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = -1;
- UiUtil.addComponent(this._pnlHeaderProperties, this._ckbHeaderUnderline, gblp, gbc, 2, 2, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(contentPanel, this._pnlHeaderProperties, gbl, gbc, 1, 1, 1, 1, (double)1.0F, (double)0.0F, 18, 1, 10, 5, 0, 0);
- gblp = new GridBagLayout();
- this._pnlDataProperties.setLayout(gblp);
- UiUtil.addComponent(this._pnlDataProperties, this._lblDataFace, gblp, gbc, 0, 0, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlDataProperties, this._txfDataFace, gblp, gbc, 1, 0, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = -2;
- UiUtil.addComponent(this._pnlDataProperties, this._ckbDataBold, gblp, gbc, 2, 0, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(this._pnlDataProperties, this._lblDataColor, gblp, gbc, 0, 1, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlDataProperties, this._cmbDataColor, gblp, gbc, 1, 1, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = -2;
- UiUtil.addComponent(this._pnlDataProperties, this._ckbDataItalic, gblp, gbc, 2, 1, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(this._pnlDataProperties, this._lblDataSize, gblp, gbc, 0, 2, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 0, 0, 0);
- UiUtil.addComponent(this._pnlDataProperties, this._cmbDataSize, gblp, gbc, 1, 2, 1, 1, (double)1.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = -2;
- UiUtil.addComponent(this._pnlDataProperties, this._ckbDataUnderline, gblp, gbc, 2, 2, 1, 1, (double)0.0F, (double)0.0F, 17, 2, 0, 5, 0, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(contentPanel, this._pnlDataProperties, gbl, gbc, 1, 2, 1, 1, (double)1.0F, (double)0.0F, 18, 1, 0, 5, 0, 0);
- UiUtil.addComponent(contentPanel, this._btnPreview, gbl, gbc, 0, 2, 1, 1, (double)1.0F, (double)0.0F, 16, 0, 0, 0, 0, 0);
- UiUtil.addComponent(contentPanel, this._scpPreview, gbl, gbc, 0, 3, 2, 1, (double)1.0F, (double)1.0F, 18, 1, 5, 0, 0, 0);
- }
-
- public void doLayout() {
- super.doLayout();
- if (this._scpPreview.getColumnHeader() != null) {
- this._scpPreview.getColumnHeader().setVisible(false);
- }
-
- }
-
- PreviewCellRenderer getPreviewTableCellRenderer() {
- return (PreviewCellRenderer)this._tblPreview.getDefaultRenderer(class$java$lang$String != null ? class$java$lang$String : (class$java$lang$String = class$("java.lang.String")));
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-